import json

from api.base_service import BaseService


class UserService(BaseService):
    def find_by_username(self, name: str):
        resp = self.dubbo_client.invoke("UserService", "findByUserName", name)
        if resp == "null":
            return None
        return json.loads(resp)


if __name__ == '__main__':
    res = UserService().find_by_username("admin")
    print("res =", res, type(res))
